/******************************************************************************
 * Filename: Printable.h
 *
 * Copyright 2012, Research In Motion Ltd
 *
 * Author: Gang Li
 *
 * Created: Jul 16, 2012
 *
 * Description:
 *
 *****************************************************************************/

#ifndef PRINTABLE_H_
#define PRINTABLE_H_

#include <stdio.h>

template <class T>
class Printable
{
private:
    T& _obj;

private:
    void _P(int i)
    {
        printf("_P %d", i);
    }

    void _P(char * c)
    {
        printf("_P %s", c);
    }

public:
    Printable(T& obj) : _obj(obj)
    {

    }

    void Print()
    {
        printf("PRN: %s\n", _obj.ToString());
        _P(_obj.data);
    }
};


#endif /* PRINTABLE_H_ */
